* here we check whether we have already run the code for generating the ballot level data
* we do this by looking for the ballot_latwpres variable
capture confirm variable ballot_latwpres
if _rc {
    di in red "running ballot level prep do file"
    quietly do "do_files/prep_GRACE_data/generate_ballot_level_data.do"
}
else {
    di in red "already ran ballot level prep do file, continuing with the rest of the file"
} 
